package com.hzo.great.leisuregreat.views;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.hzo.great.leisuregreat.R;
import com.hzo.great.leisuregreat.base.BaseActivity;
import com.hzo.great.leisuregreat.utils.SharedPreferencesUtils;

public class SetActivity extends BaseActivity {

    ImageView back;

    RelativeLayout name, phoneNum, cacheManagement, modifyPwd;

    TextView exit;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //fullScreen(this, true);
        setContentView(R.layout.mine_set);
        initView();
    }

    private void initView() {

        back = (ImageView) findViewById(R.id.back);

        name = (RelativeLayout) findViewById(R.id.name);
        phoneNum = (RelativeLayout) findViewById(R.id.phoneNum);
        cacheManagement = (RelativeLayout) findViewById(R.id.cacheManagement);
        modifyPwd = (RelativeLayout) findViewById(R.id.modifyPwd);

        exit = (TextView) findViewById(R.id.exit);

        back.setOnClickListener(this);
        name.setOnClickListener(this);
        phoneNum.setOnClickListener(this);
        cacheManagement.setOnClickListener(this);
        modifyPwd.setOnClickListener(this);
        exit.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {

        switch (view.getId()){
            case R.id.back:
                finish();
                break;
            case R.id.name:
                showToast("敬请期待");
                break;
            case R.id.phoneNum:
                showToast("敬请期待");
                break;
            case R.id.cacheManagement:
                showToast("敬请期待");
                break;
            case R.id.modifyPwd:
                startActivity(new Intent(SetActivity.this,ModifyPasswordActivity.class));
                break;
            case R.id.exit:
                SharedPreferencesUtils.removeAll();
                ActivityCollector.removeAllActivity();
                startActivity(new Intent(SetActivity.this,LoginActivity.class));
                finish();
                break;
        }
    }

    public void showToast(String toast) {
        Toast.makeText(this,toast,Toast.LENGTH_SHORT).show();
    }
}
